/* 全新的整体容器样式 */
.chat-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 100vh;
  font-family: 'Roboto', sans-serif;
  background-color: #f5f7fa;
  transition: background-color 0.5s ease-in-out;
}

/* 侧边栏样式 */
.sidebar {
  background-color: #ffffff;
  border-right: 1px solid #e0e0e0;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 工具栏按钮样式 */
.toolbar-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 16px;
  color: #333333;
  background-color: #f0f0f0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.toolbar-button:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.toolbar-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.5);
}

/* 特定按钮样式 */
.download-button {
  background-color: #3f51b5; /* 深蓝色 */
  color: #ffffff;
}

.download-button:hover {
  background-color: #303f9f;
}

.share-button {
  background-color: #4caf50; /* 绿色 */
  color: #ffffff;
}

.share-button:hover {
  background-color: #43a047;
}

.theme-button {
  background-color: #ff9800; /* 橙色 */
  color: #ffffff;
}

.theme-button:hover {
  background-color: #fb8c00;
}

/* 聊天窗口样式优化 */
.chat-window {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: background-color 0.3s ease;
}

/* 聊天气泡的通用样式 */
.chat-bubble {
  max-width: 70%;
  padding: 12px 18px;
  border-radius: 20px;
  margin: 10px;
  word-wrap: break-word;
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  animation: fadeIn 0.3s ease-in-out;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 用户消息气泡 */
.user-bubble {
  background-color: #dcf8c6;
  align-self: flex-end;
  border-top-right-radius: 0;
}

/* 助手消息气泡 */
.assistant-bubble {
  background-color: #f1f0f0;
  align-self: flex-start;
  border-top-left-radius: 0;
  position: relative;
}

/* 助手消息气泡箭头 */
.assistant-bubble::after {
  content: '';
  position: absolute;
  top: 10px;
  left: -10px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-right: 10px solid #f1f0f0;
  border-bottom: 10px solid transparent;
}

/* 头像样式 */
.t-chat-item .t-avatar {
  border: 2px solid #3f51b5; /* 深蓝色边框 */
}

/* 反馈按钮样式修改 */
.feedback-action {
  display: flex;
  gap: 10px;
}

.feedback-action .t-button {
  background: #f0f0f0;
  border: none;
  color: #333333;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.feedback-action .t-button:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.active-good {
  background-color: #4caf50; /* 绿色 */
  color: #ffffff;
}

.active-bad {
  background-color: #f44336; /* 红色 */
  color: #ffffff;
}

/* 调整聊天底部布局 */
.input-area {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-top: 1px solid #e0e0e0;
  background-color: #fafafa;
}

.chat-input {
  flex: 1;
  border-radius: 20px;
  padding: 12px 20px;
  border: 1px solid #cccccc;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.chat-input:hover,
.chat-input:focus {
  border-color: #3f51b5;
  box-shadow: 0 0 5px rgba(63, 81, 181, 0.3);
  outline: none;
}

/* 停止按钮样式 */
.stop-button {
  background-color: #f44336; /* 红色 */
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.stop-button:hover {
  background-color: #e53935;
  transform: scale(1.1);
}

/* 反馈表单对话框样式 */
.feedback-dialog {
  .t-dialog__header {
    background-color: #3f51b5; /* 深蓝色头部 */
    color: #ffffff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    font-size: 20px;
    text-align: center;
  }

  .t-dialog__body {
    padding: 30px;
    background-color: #e8eaf6; /* 淡蓝色背景 */
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .t-dialog__footer {
    background-color: #e8eaf6;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
  }
}

.submit-feedback-button {
  background-color: #4caf50; /* 绿色 */
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.submit-feedback-button:hover {
  background-color: #43a047;
}

.cancel-feedback-button {
  background-color: #9e9e9e; /* 灰色 */
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.cancel-feedback-button:hover {
  background-color: #757575;
}

.feedback-textarea {
  width: 100%;
  border: 1px solid #3f51b5;
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
}

.feedback-textarea:hover,
.feedback-textarea:focus {
  border-color: #5c6bc0;
}

/* 分享对话框样式 */
.share-dialog {
  .t-dialog__header {
    background-color: #ff9800; /* 橙色头部 */
    color: #ffffff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    font-size: 20px;
    text-align: center;
  }

  .t-dialog__body {
    padding: 30px;
    background-color: #ffe0b2; /* 淡橙色背景 */
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .t-dialog__footer {
    background-color: #ffe0b2;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
  }
}

.share-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.share-text-input {
  width: 100%;
  height: 120px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  resize: vertical;
  transition: border-color 0.3s;
}

.share-text-input:hover,
.share-text-input:focus {
  border-color: #ff9800;
  outline: none;
}

.share-image-upload {
  width: 100%;
  display: flex;
  justify-content: center;
}

.image-preview {
  position: relative;
  width: 100%;
  max-height: 250px;
  overflow: hidden;
  border-radius: 8px;
  margin-top: 15px;
}

.image-preview img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.remove-image-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  padding: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.remove-image-button:hover {
  background-color: rgba(255, 255, 255, 1);
}

.submit-share-button {
  background-color: #ff5722; /* 橙红色 */
  color: white;
  border: none;
  border-radius: 20px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.submit-share-button:hover {
  background-color: #e64a19;
}

/* 下载对话框样式 */
.download-dialog {
  .t-dialog__header {
    background-color: #3f51b5; /* 深蓝色头部 */
    color: #ffffff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    font-size: 20px;
    text-align: center;
  }

  .t-dialog__body {
    padding: 30px;
    background-color: #c5cae9; /* 淡蓝色背景 */
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .t-dialog__footer {
    background-color: #c5cae9;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    display: flex;
    justify-content: center;
    gap: 20px;
  }
}

.download-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm-download-button {
  background-color: #3f51b5; /* 深蓝色 */
  color: white;
  border: none;
  border-radius: 20px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.confirm-download-button:hover {
  background-color: #303f9f;
}

.cancel-download-button {
  background-color: #9e9e9e; /* 灰色 */
  color: white;
  border: none;
  border-radius: 20px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.cancel-download-button:hover {
  background-color: #757575;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .chat-container {
    grid-template-columns: 200px 1fr;
  }

  .sidebar {
    padding: 15px;
    gap: 15px;
  }

  .toolbar-button {
    padding: 10px 16px;
    font-size: 14px;
  }

  .submit-feedback-button,
  .cancel-feedback-button,
  .confirm-download-button,
  .cancel-download-button,
  .submit-share-button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .chat-bubble {
    padding: 10px 16px;
    font-size: 15px;
  }

  .share-text-input {
    height: 100px;
    font-size: 14px;
  }

  .feedback-textarea {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .chat-container {
    grid-template-columns: 1fr;
    grid-template-rows: 60px 1fr;
  }

  .sidebar {
    display: none; /* 隐藏侧边栏 */
  }

  .toolbar {
    justify-content: center;
    gap: 10px;
  }

  .chat-window {
    border-radius: 0;
  }

  .input-area {
    padding: 12px;
    gap: 10px;
  }

  .chat-input {
    padding: 10px 16px;
    font-size: 14px;
  }

  .share-button,
  .download-button,
  .theme-button {
    padding: 8px 16px;
    font-size: 14px;
  }

  .share-image-upload {
    max-height: 180px;
  }

  .image-preview {
    max-height: 180px;
  }

  .submit-share-button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .confirm-download-button,
  .cancel-download-button {
    padding: 10px 20px;
    font-size: 14px;
  }
}
